<template>
  <div class="madp-basic-info">
    <div class="info">
      <div class="info-item">
        <div class="left-label">性别</div>
        <div class="right-text">{{ info.genderText }}</div>
      </div>
      <div class="info-item">
        <div class="left-label">企业</div>
        <div class="right-text">{{ info.corpName || '--' }}</div>
      </div>
      <div class="info-item">
        <div class="left-label">手机号码</div>
        <div class="right-text">{{ info.phone || '--' }}</div>
      </div>
      <div class="info-item">
        <div class="left-label">添加时间</div>
        <div class="right-text">{{ info.createTime || '--' }}</div>
      </div>
      <div class="info-item">
        <div class="left-label">类型</div>
        <div class="right-text">{{ info.typeText || '--' }}</div>
      </div>
      <div class="info-item">
        <div class="left-label">来源</div>
        <div class="right-text">{{ info.addWayText || '--' }}</div>
      </div>
      <div class="info-item cursor-pointer" @click="intoCRMDetail" v-if="info.contactFieldPivotList && info.contactFieldPivotList.length > 0">
        <div class="left-label">CRM</div>
        <div class="right-text" style="text-align: right">客户详情<i class="el-icon-arrow-right"></i></div>
      </div>
    </div>
    <div class="number cursor-pointer" @click="intoDetail">
      <div class="count">
        <span>{{ info.employeeList.length }}</span>
        <span>TA添加的</span>
      </div>
      <div class="avaters">
        <div class="avater-bg" v-if="info.employeeList[0]">
          <img :src="info.employeeList[0].avatar || $defaultAvatar" alt="" />
        </div>
        <div class="avater-bg" v-if="info.employeeList[1]">
          <img :src="info.employeeList[1].avatar || $defaultAvatar" alt="" />
        </div>
      </div>
      <div class="qun-count">
        <span>共{{ info.roomList.length }}个群聊</span>
        <i class="el-icon-arrow-right"></i>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  components: {},
  data() {
    return {}
  },
  props: {
    info: {
      type: Object,
      default: () => {
        return {}
      }
    }
  },
  created() {},
  mounted() {},
  methods: {
    intoCRMDetail() {
      this.$router.push({
        path: '/customerDetail/crm-customer-detail',
        query: {
          infoList: this.info.contactFieldPivotList
        }
      })
    },
    intoDetail() {
      this.$router.push({
        path: '/customerDetail/member-list',
        query: {
          employeeList: this.info.employeeList,
          roomList: this.info.roomList
        }
      })
    }
  }
}
</script>
<style scoped lang='scss'>
.info {
  padding: 10px 16px;
  background: #ffffff;
  box-shadow: 0px 3px 6px 0px rgba(181, 181, 181, 0.16);
  border-radius: 8px;
  .info-item {
    display: flex;
    padding: 13px 0;
    box-shadow: inset 0px -1px 0px 0px rgba(44, 44, 44, 0.1);
    .left-label {
      width: 80px;
      font-size: 15px;
      font-family: PingFangSC-Regular, PingFang SC;
      font-weight: 400;
      color: rgba(44, 44, 44, 0.8);
      line-height: 21px;
    }
    .right-text {
      flex: 1;
      font-size: 15px;
      font-family: PingFangSC-Regular, PingFang SC;
      font-weight: 400;
      color: #2c2c2c;
      line-height: 21px;
    }
    &:last-child {
      box-shadow: none;
    }
  }
}
.number {
  margin-top: 10px;
  padding: 10px 16px;
  background: #ffffff;
  box-shadow: 0px 3px 6px 0px rgba(181, 181, 181, 0.16);
  border-radius: 8px;
  display: flex;
  align-items: center;
  .count {
    :nth-child(1) {
      display: flex;
      flex-direction: column;
      font-size: 18px;
      font-family: Roboto-Medium, Roboto;
      font-weight: 500;
      color: rgba(44, 44, 44, 0.8);
    }
    :nth-child(2) {
      font-size: 10px;
      font-family: PingFangSC-Medium, PingFang SC;
      font-weight: 500;
      color: rgba(44, 44, 44, 0.4);
    }
  }
  .avaters {
    flex: 1;
    display: flex;
    margin-left: 8px;
    .avater-bg {
      width: 30px;
      height: 30px;
      border-radius: 50%;
      border: 2px solid #ffffff;
      overflow: hidden;
      img {
        width: 100%;
        height: 100%;
      }
    }
    :nth-child(2) {
      margin-left: -5px;
    }
  }
  .qun-count {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 30px;
    background: rgba(237, 85, 85, 0.1);
    border-radius: 13px;
    span {
      font-size: 14px;
      font-family: PingFangSC-Regular, PingFang SC;
      font-weight: 400;
      color: #ed5555;
    }
    i {
      color: #ed5555;
      font-weight: 600;
      font-size: 14px;
      margin-left: 6px;
    }
  }
  .crm-detail {
    flex: 1;
    text-align: right;
  }
}
</style>